package com.example.ayniu.treadmill.util;

import android.content.Context;
import android.support.v4.view.ViewPager;
import android.util.AttributeSet;

import com.example.ayniu.treadmill.fragment.Fragment_main;

/**
 * Created by Ayniu on 2017/4/4.
 */
public class MyViewPager extends ViewPager {

    public MyViewPager(Context context) {
        super(context);
    }

    public MyViewPager(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    //重写ViewPager scrollTo方法，实现在常规训练进行时，不可滑动
    @Override
    public void scrollTo(int x, int y){
        if (Fragment_main.MAIN_STATUS == Fragment_main.MAIN_STATUS_START){
            super.scrollTo(x, y);
        }
    }
}
